// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
//
// Copyright (c) 2015-2016 Andrey Antukh <niwi@niwi.nz>
// Copyright (c) 2015-2016 Juan de la Cruz <delacruzgarciajuan@gmail.com>

.sitemap {
  flex: none !important;

  .element-list {

    li {
      align-items: center;
      display: flex;
      flex-direction: row;
      width: 100%;

      .page-icon {

        svg {
          fill: $color-gray-30;
          height: 13px;
          margin-right: $x-small;
          width: 13px;
        }

      }

      span {
        color: $color-gray-20;
        font-size: $fs12;
        max-width: 75%;
        overflow-x: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      .page-actions {
        align-items: center;
        display: none;
        margin-left: auto;

        a {

          svg {
            fill: $color-gray-60;
            height: 15px;
            margin-left: $x-small;
            width: 15px;
          }

        }

      }

      &:hover {
        background-color: $color-primary;

        .page-icon {

          svg {
            fill: $color-gray-60;
          }

          span {
            color: $color-gray-60;
          }

        }

        .page-actions {
          display: flex;
        }

      }

      &.selected {

        .page-icon {

          svg {
            fill: $color-primary;
          }

        }

        span {
          color: $color-primary;
        }

      }

      &:hover {

        .page-icon {

          svg {
            fill: $color-gray-60;
          }
        }

        span {
          color: $color-gray-60;
        }
      }

    }

    .element-list-body {
      align-items: center;
      display: flex;
      padding: $x-small $small;
      transition: none;
      width: 100%;

      svg {
        fill: $color-gray-60;
        height: 13px;
        margin-right: 8px;
        width: 13px;
      }

      .element-actions {
        align-items: center;
        display: flex;
        flex-shrink: 0;
        width: 62px;
      }

      &.dragging {
        // TODO: revisit this
        background-color: $color-gray-10;
      }
    }
  }
}

.add-page,
.collapse-pages {
  align-items: center;
  background-color: transparent;
  border-radius: $br-small;
  border: 1px solid transparent;
  cursor: pointer;
  display: flex;
  justify-content: center;
  margin-left: auto;
  padding: $x-small;

  svg {
    fill: $color-gray-20;
    height: 0.7rem;
    width: 0.7rem;
  }

  &:hover {
    background-color: $color-primary;

    svg {
      fill: $color-gray-60 !important;
    }
  }
}

.element-set-title-actions {
  display: flex;
  flex-direction: row;
  flex: 1;
  justify-content: flex-end;

  .add-page {
    margin: 0;
  }
}

.collapse-pages {
  margin-left: $small;

  svg {
    transform: rotate(90deg);
  }
}
